<html>
<head><meta charset="utf-8"><title>Find attr on HIR item · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Find.20attr.20on.20HIR.20item.html">Find attr on HIR item</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="235350937"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Find%20attr%20on%20HIR%20item/near/235350937" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Hughes <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Find.20attr.20on.20HIR.20item.html#235350937">(Apr 20 2021 at 14:17)</a>:</h4>
<p>Hi, it looks like the <code>attrs</code> field was removed from <code>hir::Item</code> a few months ago (c70187). Is there a new workflow for getting the attributes for an item?</p>



<a name="235351284"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Find%20attr%20on%20HIR%20item/near/235351284" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Find.20attr.20on.20HIR.20item.html#235351284">(Apr 20 2021 at 14:20)</a>:</h4>
<p><span class="user-mention" data-user-id="223286">@Jake Hughes</span> <code>tcx.hir().attrs(item.hir_id)</code> should work</p>



<a name="235351681"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Find%20attr%20on%20HIR%20item/near/235351681" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Hughes <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Find.20attr.20on.20HIR.20item.html#235351681">(Apr 20 2021 at 14:22)</a>:</h4>
<p><span class="user-mention" data-user-id="232545">@Joshua Nelson</span> Nice one. Thanks!</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>